/*    */ package com.zimbra.cs.servlet.util;
/*    */ 
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import org.eclipse.jetty.io.EndPoint;
/*    */ import org.eclipse.jetty.server.HttpConnection;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class JettyUtil
/*    */ {
/*    */   public static void setIdleTimeout(long timeout, HttpServletRequest request)
/*    */   {
/* 30 */     if (request != null) {
/* 31 */       Object attr = request.getAttribute("org.eclipse.jetty.server.HttpConnection");
/* 32 */       if ((attr instanceof HttpConnection))
/*    */       {
/* 34 */         HttpConnection conn = (HttpConnection)attr;
/* 35 */         EndPoint ep = conn.getEndPoint();
/* 36 */         if (ep != null) {
/* 37 */           ep.setIdleTimeout(timeout);
/*    */         } else {
/* 39 */           ZimbraLog.misc.warn("null endpoint setting Jetty timeout?", new Exception());
/*    */         }
/*    */       }
/*    */       else {
/* 43 */         ZimbraLog.misc.warn("got [%s] not instanceof org.eclipse.jetty.server.HttpConnection", attr, new Exception());
/*    */       }
/*    */     } else {
/* 46 */       ZimbraLog.misc.warn("cannot set timeout for null request", new Exception());
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/servlet/util/JettyUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */